insertChild

abstract fun insertChild(parent: DesignBlock, child: DesignBlock, index: Int)

Insert a new or existing child at a certain position in the parent's children. A move fails when it would put a block with a matte inside its matte source, or on another page than its source. A page slice takes no children, and it can only be a child of a page with a rect shape. A video scene takes no page slice. A page slice that a block load or duplicate returns holds the blocks that it was saved with. The next update moves them onto the page, into the new place of the page slice. Required scope: "editor/add"

For a scene that arranges its pages, the index counts the children without the camera.

Parameters

parent

the block to update.

child

the child to insert. Can be an existing child of parent.

index

the index to insert or move to.